home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Chess++ 3.0.1 / source / CChessBoard.h < prev    next >
Text File  |  1993-05-05  |  1KB  |  40 lines

  1. /****
  2.  * CChessBoard.h
  3.  *
  4.  *    Class representing the Chess Board and its contents.
  5.  *
  6.  *    Copyright © 1993 Steven J. Bushell. All rights reserved.
  7.  *
  8.  ****/
  9.  
  10. //#define    _H_CChessBoard            /* Include this file only once */
  11. #pragma once
  12.  
  13. #include "CChessPane.h"
  14.  
  15. enum { NoColor, Black, White };
  16.  
  17. class CChessBoard : public CObject {
  18.  
  19.     CChessPane    *itsChessPane;
  20.     CChessPiece *theBoard[10][10];
  21.     Boolean        gameOver;
  22.     Boolean        awaitingFirstClick;
  23.     short        firstClickRank,firstClickFile;
  24.     short        lastFirstClickRank,lastFirstClickFile;
  25.     short        lastSecondClickRank,lastSecondClickFile;
  26.     short        myColor,theOtherPlayersColor;
  27.     short        whiteKingRank,whiteKingFile,blackKingRank,blackKingFile;
  28.  
  29.                                     /** Contruction/Destruction **/
  30.     void            IChessBoard(CChessPane *theChessPane);
  31.  
  32.                                     /** Mouse **/
  33.     void            DoClick(Point hitPt, short modifierKeys, long when);
  34.     void            ShowPossibleMoves(void);
  35.     virtual void     RegisterMove(short rank, short file);
  36.     void            RegisterKingLocation(short theColor, short rank, short file);
  37.     Boolean            CheckForCheck(short rank, short file);
  38. };
  39.  
  40. pascal    void    TrackPiece(void);    // routine to track piece while dragging